Skip to content

Initial compiler PR#1

Merged
jamesadevine merged 2 commits into
mainfrom
devinejames/init-compiler
Mar 6, 2026
Merged

Initial compiler PR#1
jamesadevine merged 2 commits into
mainfrom
devinejames/init-compiler

Conversation

@jamesadevine

Copy link
Copy Markdown
Collaborator

Add ADO compiler and set up actions to run.

@jamesadevine jamesadevine merged commit feff3ba into main Mar 6, 2026
1 check passed
@jamesadevine jamesadevine deleted the devinejames/init-compiler branch March 6, 2026 14:15
jamesadevine added a commit that referenced this pull request May 8, 2026
Two findings + three suggestions from the latest Rust PR Reviewer pass:

1. Stage-3 typed-deserialize errors after codemods reused the same
   "Failed to parse YAML front matter" context as the Stage-1 raw
   parse, so a codemod that produced an invalid shape was
   indistinguishable from a user typo. Switch to with_context that
   surfaces the applied codemod ids when codemods ran:
   "Failed to parse YAML front matter after applying codemods (id1, id2);
    a codemod likely produced an invalid shape".

2. rename_key with ConflictPolicy::PreferNew returns Ok(true) when
   it drops a stale `old` key even though `new` is unchanged. That
   triggers a source-rewrite warning saying "we migrated" when
   really we "cleaned up a remnant". The behavior is correct (the
   mapping did mutate); the doc was misleading. Rewrote the
   rename_key doc comment to enumerate exactly when Ok(true) fires
   and call out the PreferNew/cleanup case.

3. Added `// TODO(codemods): remove when the first real codemod is
   registered.` markers next to every #[allow(dead_code)] /
   #[allow(unused_imports)] in src/compile/codemods/{mod,helpers}.rs
   so search-based cleanup is trivial when the registry stops being
   empty.

4. tests/codemod_tests.rs leaked temp dirs on assertion failure
   because `let _ = fs::remove_dir_all(&dir)` only ran on the happy
   path. Refactored to return tempfile::TempDir from the helpers
   and rely on RAII cleanup, matching the pattern already used by
   src/compile/codemod_integration_test.rs.

Skipped: the empty-mapping concern in reconstruct_source (a
mapping reduced to empty wouldn't deserialize as FrontMatter
anyway because of required name/description fields, so the
existing typed-deserialize error path catches it; #1 makes that
error informative).

All 1349 tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant